/*
 * @Author: Wang WeiHao
 * @Date: 2024-09-23 14:42:49
 * @LastEditors: Wang WeiHao
 * @LastEditTime: 2024-10-12 10:23:24
 * @Description:
 * @FilePath: \geo-base-dm\src\store\modules\task\index.ts
 */
import { defineStore } from "pinia";

import { TaskState } from "./types";

export const useTaskStore = defineStore("task", {
	state: (): TaskState => ({
		taskStatus: false,
		taskInfo: null,
		currentInterpretType: Object.keys(BASE_CONFIG.vectorColor).toString(),
		viewftp: null,
		shpPopshow: false,
		vecPopshow: false,
		vecLegendShow: false,
		leftLegendShow: false,
		rightLegendShow: false,
		changeDetctionPopshow: false,
	}),
	getters: {
		userTaskStates(state: TaskState): TaskState {
			return { ...state };
		},
	},
	actions: {
		// 设置state的信息
		setInfo(partial: Partial<TaskState>) {
			this.$patch(partial);
		},
		// 重置state信息
		resetInfo() {
			this.$reset();
		},
	},
});
